package com.topnav.mc.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.topnav.mc.admin.bean.cachebean.CacheOrgBean;
import com.topnav.mc.admin.entity.Device;
import com.topnav.mc.admin.entity.Organization;
import com.topnav.mc.admin.entity.User;
import com.topnav.mc.admin.entity.bean.OrganizationBean;
import com.topnav.mc.admin.entity.param.OrganizationParam;
import com.topnav.mc.base.mc.IMcService;

import java.util.List;
import java.util.Map;

/**
 * 说明：Organization接口服务
 * @类名: IOrganizationService
 * <p>
 *
 * </p>
 * @author   kenny
 * @Date	 2021年11月19日上午9:27:38
 */
//public interface IOrganizationService extends IService<Organization>{
public interface  IOrganizationService extends IMcService<Organization, OrganizationBean, OrganizationParam> {

    /**
     * 取得该用户的所有单位
     * @param userId
     * @return
     */
    List<Organization> fingAllOrgByUser(Long userId);


    /**
     * 取当前登录用户的单位列表
     * @param user
     * @return
     */
    List<Object> genOrgOfLoginUser(User user);

    /**
     * 保存到缓存
     */
    void saveToCache(Organization organization);
    void saveAllToCache();
    void removeFromCache(Long orgId);

    /**
     * 从缓存取设备
     */
    CacheOrgBean getFromCache(Long orgId);
    List<CacheOrgBean> getAllFromCache();

}
